package com.zlict.admin.service.impl;

import com.zlict.admin.domain.ProjectPrepare;
import com.zlict.admin.mapper.ProjectPrepareSurveyMapper;
import com.zlict.admin.service.IProjectPrepareSurveyService;
import com.zlict.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

import static com.zlict.common.utils.SecurityUtils.getUserId;

/**
 * 项目筹备 调研Service业务层处理
 * 
 * @author dzw
 * @date 2025-06-10
 */
@Service
public class ProjectPrepareSurveyServiceImpl implements IProjectPrepareSurveyService
{
    @Autowired
    private ProjectPrepareSurveyMapper projectPrepareSurveyMapper;

    /**
     * 查询项目筹备 调研
     * 
     * @param id 项目筹备 调研主键
     * @return 项目筹备 调研
     */
    @Override
    public ProjectPrepare selectProjectPrepareById(Long id)
    {
        return projectPrepareSurveyMapper.selectProjectPrepareById(id);
    }

    /**
     * 查询项目筹备 调研列表
     * 
     * @param ProjectPrepare 项目筹备 调研
     * @return 项目筹备 调研
     */
    @Override
    public List<ProjectPrepare> selectProjectPrepareList(ProjectPrepare ProjectPrepare)
    {
        return projectPrepareSurveyMapper.selectProjectPrepareList(ProjectPrepare);
    }

    /**
     * 新增项目筹备 调研
     * 
     * @param ProjectPrepare 项目筹备 调研
     * @return 结果
     */
    @Override
    public int insertProjectPrepare(ProjectPrepare ProjectPrepare)
    {
        ProjectPrepare.setCreateTime(DateUtils.getNowDate());
        ProjectPrepare.setCreateBy(getUserId());
        return projectPrepareSurveyMapper.insertProjectPrepare(ProjectPrepare);
    }

    /**
     * 修改项目筹备 调研
     * 
     * @param ProjectPrepare 项目筹备 调研
     * @return 结果
     */
    @Override
    public int updateProjectPrepare(ProjectPrepare ProjectPrepare)
    {
        ProjectPrepare.setUpdateTime(DateUtils.getNowDate());
        ProjectPrepare.setUpdateBy(getUserId());
        return projectPrepareSurveyMapper.updateProjectPrepare(ProjectPrepare);
    }

    /**
     * 批量删除项目筹备 调研
     * 
     * @param ids 需要删除的项目筹备 调研主键
     * @return 结果
     */
    @Override
    public int deleteProjectPrepareByIds(Long[] ids)
    {
        return projectPrepareSurveyMapper.deleteProjectPrepareByIds(ids);
    }

    /**
     * 删除项目筹备 调研信息
     * 
     * @param id 项目筹备 调研主键
     * @return 结果
     */
    @Override
    public int deleteProjectPrepareById(Long id)
    {
        return projectPrepareSurveyMapper.deleteProjectPrepareById(id);
    }
}
